import {
  download
} from "../../request";

export const batchExport = {
  data() {
    return {
      exPortLoading: false
    }
  },
  methods: {
    // 批量导出
    // url: "/restful/ybam/baseCommission/exportBaseCommissionList"
    // name: 不默认加后缀
    batchExport(obj) {
      !obj.tableData && (obj.tableData = this.tableData)
      if (obj.tableData && obj.tableData.length == 0) this.$message.error(obj.msg || "列表无数据，不可进行此操作");
      else {
        this.exPortLoading = true;
        if (!obj.callback) obj.callback = () => (this.exPortLoading = false)
        // download(obj.url, obj.obj || this.form, obj.name, obj.callback, obj.method);
        obj.params = obj.obj || this.form
        // console.log('obj',obj);
        download(obj);
      }
    },
  }
}
